import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/frameWork";
// 查询案款发放列表
export function listPayment(query) {
  return request({
    url: '/supervision/payment/list',
    method: 'get',
    params: query
  })
}
// 查询案款发放详细
export function getPayment(query) {
  return request({
    url: '/supervision/payment/getDetail',
    method: 'get',
    params: query
  })
}
// 新增案款发放
export function addPayment(data) {
  return request({
    url: '/supervision/payment/add',
    method: 'post',
    data: data
  })
}
// 修改案款发放
export function updatePayment(data) {
  return request({
    url: '/supervision/payment/update',
    method: 'put',
    data: data
  })
}

// 检测案件发放金额是否超额(返回布尔型)
export function checkMoney(data) {
  return request({
    url: '/supervision/payment/checkNeedMoney',
    method: 'post',
    data: data
  })
}

export function checkPayMoney(query) {
  return request({
    url: '/supervision/payment/checkPayMoney',
    method: 'get',
    params: query
  })
}

// 得到应发金额
export function getNeedMoney(query) {
  return request({
    url: '/supervision/person/getNeedMoney',
    method: 'get',
    params: query
  })
}
// 删除案款发放
export function delPayment(data) {
  return request({
    url: '/supervision/payment/deletePayMent',
    method: 'post',
    data:data,
  })
}
// oucode查询
export function getPersonInfoByZjh(zjh) {
  return request({
    url: '/supervision/involvedPerson/getPersonInfoByZjh?zjh=' + zjh,
    method: 'get'
  })
}
export function getDateByPayRound(query) {
  return request({
    url: '/supervision/payment/getDateByPayRound',
    method: 'get',
    params: query
  })
}
// 用户状态修改
// export function getDateByPayRound(userId, status) {
//   const data = {
//     userId,
//     status
//   }
//   return request({
//     url: '/payment/getDateByPayRound',
//     method: 'put',
//     data: data
//   })
// }

// 查询案款每次下拉列表
export function getlistCase(query) {
  return request({
    url: '/supervision/caseManagement/getlist',
    method: 'get',
    params: query
  })
}

// 校验应发金额
export function editCheckMoney(query) {
  return request({
    url: '/supervision/payment/editCheckMoney',
    method: 'get',
    params: query
  })
}
//根据任务得到案件
export function queryByFjbm(fjbm) {
  return request({
    url: '/supervision/tjczdxx/queryByFjbm?fjbm='+fjbm,
    method: 'get'
  })
}
export function getPersonInfoByCaseId(caseId) {
  return request({
    url: '/supervision/person/getPersonInfoByCaseId?caseId='+caseId,
    method: 'get'
  })
}
export function getWholePersonByZjh(zjh,caseId) {
  return request({
    url: '/supervision/involvedPerson/getWholePersonByZjh?zjh='+zjh+'&caseId='+caseId,
    method: 'get'
  })
}

export function judgePayMoney(money,zjh,caseId) {
  return request({
    url: '/supervision/payment/judgePayMoney?money='+money+'&zjh='+zjh+'&caseId='+caseId,
    method: 'get'
  })
}